package mmc.networking.data;

import java.io.IOException;
import mmc.EngineObject;
import mmc.objects.RemotePlayer;
import mmc.server.Player;

@SuppressWarnings("serial")
public class AddUpdate extends Update{
	public EngineObject o;
	
	public AddUpdate(EngineObject o){
		if(o instanceof Player){
			this.o = new RemotePlayer((Player) o);
			this.o.id = o.id;
		}else
			this.o = o;
	}
	
	private void writeObject(java.io.ObjectOutputStream out) throws IOException{
		out.writeUnshared(o);
	}
 
	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException{
		o = (EngineObject) in.readObject();
	}
}
